console.log('hello');
var age = 20;
console.log(age);
var numbers = [1, 2, 3, 4];
for (var key in numbers) {
    console.log(key);
}
var b = [true, true, false];
b.forEach(function (element) {
    console.log(element);
});
var arr = ['a', 4, 'y', 1, 2, 3];
arr.flatMap(function (ele) {
    console.log(ele);
});
arr.forEach(function (ele) {
    console.log(ele);
});
function add(num1, num2) {
    return num1 + num2;
}
console.log("plus==" + add(3, 9));
//等价写法
var add2 = function (num1, num2) {
    return num1 + num2;
};
console.log("plus2==" + add2(6, 8));
function greet(name) {
    console.log("hello " + name);
}
greet('wade');
//等价写法
var greet2 = function (name) {
    console.log("hello " + name);
};
greet2('james');
//字面量类型
function changeDirection(direction) {
}
changeDirection('left');
//枚举类型
var Direction;
(function (Direction) {
    Direction[Direction["up"] = 0] = "up";
    Direction[Direction["down"] = 1] = "down";
    Direction[Direction["left"] = 2] = "left";
    Direction[Direction["right"] = 3] = "right";
})(Direction || (Direction = {}));
function printDirection(direction) {
    console.log('direction==' + direction);
}
printDirection(Direction.left);
